package com.qlm.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.jfinal.plugin.activerecord.Db;
import com.qlm.service.ShopMgr;

/**
 * 每天0点执行
 * @author wangzih
 */
public class PrizeJob implements Job{
	
	static Logger logger = LoggerFactory.getLogger(ShopMgr.class);

	
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		updateYHQState();
	}
	
	/**
	 * 每晚更新优惠券状态
	 */
	private void updateYHQState(){
		Db.update("update t_yhq set status_ = 2 where dead_time_ <=now()");
		logger.info("检查优惠券完成");
	}

}
